import 'package:enterprise_v6_app/app/components/custom_modele/custom_intrinsic_circle_line.dart';
import 'package:enterprise_v6_app/app/core/core.dart';
import 'package:enterprise_v6_app/app/modules/application/special_operation/special_list/job_ticket/common/common_work_detail_all/work_operation_record/work_operation_record_controller.dart';

///动火作业-作业记录页面
class WorkOperationRecordWidget extends StatelessWidget {
  WorkOperationRecordWidget({super.key});

  final controller = Get.put(WorkOperationRecordController());

  ///获取流程显示
  Widget _getTrainView(String value) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        Text(
          '作业计划申请',
          style: TextStyle(
            fontSize: 15.sp,
            fontWeight: FontWeight.w400,
            color: const Color(0xff262F38),
          ),
        ),
        AppGaps.vGap16,
        Container(
          padding: EdgeInsets.all(12.w),
          alignment: Alignment.topLeft,
          decoration: BoxDecoration(
            color: const Color(0xffF7F7FB),
            border: Border.all(
              color: const Color(0xffEBEDF0),
              width: 1.w,
            ),
            borderRadius: BorderRadius.circular(4.r),
          ),
          constraints: BoxConstraints(minHeight: 80.w),
          child: Text(
            value,
            style: TextStyle(
              fontSize: 13.sp,
              fontWeight: FontWeight.w400,
              color: const Color(0xff9FA5B0),
            ),
          ),
        ),
        AppGaps.vGap16,
      ],
    );
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.white,
      margin: EdgeInsets.only(top: 12.w),
      alignment: Alignment.center,
      child: Column(
        children: [
          Container(
            height: 4.w,
            color: const Color(0xff587DF5),
          ),
          ListView.builder(
              padding: EdgeInsets.symmetric(horizontal: 27.w, vertical: 22.w),
              itemCount: controller.list.length,
              shrinkWrap: true,
              physics: const BouncingScrollPhysics(),
              itemBuilder: (context, index) {
                return CustomIntrinsicCircleLine(
                  showWidget: _getTrainView(controller.list[index]),
                );
              }),
        ],
      ),
    );
  }
}
